/**
 * Copyright：2020，TLF工作室。
 */
package com.cqeec.netdisc.service;

import java.io.InputStream;

import org.openstack4j.model.common.Payloads;
import org.springframework.stereotype.Service;

import com.cqeec.netdisc.util.OpenStackClientUtil;

/**
 * @author 唐礼飞
 * 
 * @date 2020-11-03 14:53:23
 *
 */
@Service
public class FileServiceImpl implements FileService {

	@Override
	public void uploadFile(String path, String fileName, InputStream inputStream) {
		OpenStackClientUtil.getOSClient().objectStorage().objects().put(path, fileName, Payloads.create(inputStream));
	}

	@Override
	public void deleteFile(String path, String name) {
		OpenStackClientUtil.getOSClient().objectStorage().objects().delete(path, name);
	}

}
